﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using Business_Layer;

namespace Control_Layer
{
    // See UseCase:
    // UCD01-MODIFICATIONS (01)
    public class CCEditSelected
    {
        private Service service;
        private Project project;
        private CCSelectComponent ccSelectComponent;

        public CCEditSelected()
        {
            service = Service.GetInstance;
            project = service.GetProject;
            ccSelectComponent = service.GetCCSelectComponent;
        }

        /// <summary>
        /// Edit the current selected components' color.
        /// </summary>
        /// <param name="color">A new color for the component.</param>
        public void EditColor(Color color)
        {
            project.EditComponentsColor(color);
        }

        /// <summary>
        /// Edit the current selected components' text.
        /// </summary>
        /// <param name="text">A new text for the component.</param>
        public void EditText(string text)
        {
            project.EditComponentsText(text);
        }

        /// <summary>
        /// Delete the current selected component.
        /// </summary>
        public void DeleteComponent()
        {
            project.DeleteSelected();
        }

        /// <summary>
        /// Get the current selected components' text.
        /// </summary>
        /// <returns></returns>
        public string GetText()
        {
            return project.GetComponentsText();
        }

        /// <summary>
        /// Moves the component in the specified directions.
        /// </summary>
        /// <param name="dx">Direction X.</param>
        /// <param name="dy">Direction Y.</param>
        public void MoveComponent(int dx, int dy)
        {
            project.MoveComponent(dx, dy);
        }

        /// <summary>
        /// Add an alternate function to the current selected component.
        /// </summary>
        /// <param name="argument"></param>
        public void AddAlternate(string argument)
        {
            project.AddAlternate(argument); 
        }
    }
}
